import myAxios from '@/utils/request'
import type { TrademarkListDataModel, TrademarkModel } from './model/trademarkModel'


//添加枚举，通一管理接口
enum Api {
    //获取品牌列表数据
    reqGetTrademarkInfoDataApi = '/admin/product/baseTrademark',
    //添加品牌
    reqTrademarkSave = '/admin/product/baseTrademark/save',
    //修改品牌
    requpdateTrademark = `/admin/product/baseTrademark/update`,
    //删除品牌
    reqDeleteTrademark = `/admin/product/baseTrademark/remove/`
}

//测试请求
export const reqManagerUser = (page: number, limit: number) => myAxios.get(`/admin/acl/user/${page}/${limit}`)

//1.获取品牌列表
export const reqGetTrademarkList = (page: number, limit: number) => {
    return myAxios.get<any, TrademarkListDataModel>(`${Api.reqGetTrademarkInfoDataApi}/${page}/${limit}`)
}

//添加品牌功能
export const reqAddTrademark = (trademarkInfo: TrademarkModel) => {
    return myAxios.post<any, null>(`${Api.reqTrademarkSave}`, trademarkInfo)
}

//更新品牌
export const reqUpdateTrademark = (trademarkInfo: TrademarkModel) => {
    return myAxios.put<any, null>(`${Api.requpdateTrademark}`, trademarkInfo)
}

//删除一个品牌
export const reqDeleteTrademarkInfo = (id: number) => {
    return myAxios.delete<any, null>(`${Api.reqDeleteTrademark}/${id}`)
}